home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 March / Pc Users extra 6.iso / pshare95 / prog / formula1 / vcform1.z / SelectFields.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-08  |  8.6 KB  |  270 lines

  1. VERSION 5.00
  2. Begin VB.Form SelectFields 
  3.    Caption         =   "Report Wizard"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   60
  6.    ClientTop       =   405
  7.    ClientWidth     =   6465
  8.    Icon            =   "SelectFields.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4665
  13.    ScaleWidth      =   6465
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.CommandButton btnFinish 
  16.       Caption         =   "&Finish"
  17.       Height          =   375
  18.       Left            =   5160
  19.       TabIndex        =   10
  20.       Top             =   4200
  21.       Width           =   975
  22.    End
  23.    Begin VB.CommandButton btnNext 
  24.       Caption         =   "&Next >"
  25.       Height          =   375
  26.       Left            =   3975
  27.       TabIndex        =   9
  28.       Top             =   4185
  29.       Width           =   975
  30.    End
  31.    Begin VB.CommandButton btnBack 
  32.       Caption         =   "< &Back"
  33.       Height          =   375
  34.       Left            =   2985
  35.       TabIndex        =   8
  36.       Top             =   4200
  37.       Width           =   975
  38.    End
  39.    Begin VB.CommandButton btnCancel 
  40.       Cancel          =   -1  'True
  41.       Caption         =   "Cancel"
  42.       Height          =   375
  43.       Left            =   1800
  44.       TabIndex        =   7
  45.       Top             =   4200
  46.       Width           =   975
  47.    End
  48.    Begin VB.CommandButton btnRemoveAllFields 
  49.       Caption         =   "<<"
  50.       BeginProperty Font 
  51.          Name            =   "MS Sans Serif"
  52.          Size            =   8.25
  53.          Charset         =   0
  54.          Weight          =   700
  55.          Underline       =   0   'False
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       Height          =   255
  60.       Left            =   3000
  61.       TabIndex        =   6
  62.       Top             =   2880
  63.       Width           =   495
  64.    End
  65.    Begin VB.CommandButton btnRemoveField 
  66.       Caption         =   "<"
  67.       BeginProperty Font 
  68.          Name            =   "MS Sans Serif"
  69.          Size            =   8.25
  70.          Charset         =   0
  71.          Weight          =   700
  72.          Underline       =   0   'False
  73.          Italic          =   0   'False
  74.          Strikethrough   =   0   'False
  75.       EndProperty
  76.       Height          =   255
  77.       Left            =   3000
  78.       TabIndex        =   5
  79.       Top             =   2520
  80.       Width           =   495
  81.    End
  82.    Begin VB.CommandButton btnGetAllFields 
  83.       Caption         =   ">>"
  84.       BeginProperty Font 
  85.          Name            =   "MS Sans Serif"
  86.          Size            =   8.25
  87.          Charset         =   0
  88.          Weight          =   700
  89.          Underline       =   0   'False
  90.          Italic          =   0   'False
  91.          Strikethrough   =   0   'False
  92.       EndProperty
  93.       Height          =   255
  94.       Left            =   2985
  95.       TabIndex        =   4
  96.       Top             =   1920
  97.       Width           =   495
  98.    End
  99.    Begin VB.CommandButton btnGetField 
  100.       Caption         =   ">"
  101.       BeginProperty Font 
  102.          Name            =   "MS Sans Serif"
  103.          Size            =   8.25
  104.          Charset         =   0
  105.          Weight          =   700
  106.          Underline       =   0   'False
  107.          Italic          =   0   'False
  108.          Strikethrough   =   0   'False
  109.       EndProperty
  110.       Height          =   255
  111.       Left            =   3000
  112.       TabIndex        =   3
  113.       Top             =   1560
  114.       Width           =   495
  115.    End
  116.    Begin VB.ListBox lstSelectedFields 
  117.       Height          =   1815
  118.       Left            =   3840
  119.       TabIndex        =   2
  120.       Top             =   1440
  121.       Width           =   2535
  122.    End
  123.    Begin VB.ListBox lstAvailable 
  124.       Height          =   1815
  125.       Left            =   120
  126.       TabIndex        =   1
  127.       Top             =   1440
  128.       Width           =   2535
  129.    End
  130.    Begin VB.ComboBox cboTables 
  131.       Height          =   315
  132.       Left            =   120
  133.       TabIndex        =   0
  134.       Top             =   600
  135.       Width           =   2535
  136.    End
  137.    Begin VB.Line Line2 
  138.       BorderColor     =   &H80000003&
  139.       X1              =   120
  140.       X2              =   6360
  141.       Y1              =   3945
  142.       Y2              =   3945
  143.    End
  144.    Begin VB.Line Line1 
  145.       BorderColor     =   &H80000005&
  146.       X1              =   120
  147.       X2              =   6360
  148.       Y1              =   3960
  149.       Y2              =   3960
  150.    End
  151.    Begin VB.Label Label5 
  152.       Caption         =   "Selected Fields:"
  153.       Height          =   255
  154.       Left            =   3840
  155.       TabIndex        =   15
  156.       Top             =   1200
  157.       Width           =   1695
  158.    End
  159.    Begin VB.Label Label4 
  160.       Caption         =   "Available Fields:"
  161.       Height          =   255
  162.       Left            =   120
  163.       TabIndex        =   14
  164.       Top             =   1200
  165.       Width           =   1695
  166.    End
  167.    Begin VB.Label Label3 
  168.       Caption         =   "Tables"
  169.       Height          =   255
  170.       Left            =   120
  171.       TabIndex        =   13
  172.       Top             =   360
  173.       Width           =   1695
  174.    End
  175.    Begin VB.Label Label2 
  176.       Caption         =   "You can choose from more than one table."
  177.       Height          =   255
  178.       Left            =   2880
  179.       TabIndex        =   12
  180.       Top             =   480
  181.       Width           =   3015
  182.    End
  183.    Begin VB.Label Label1 
  184.       Caption         =   "Which fields do you want on your report?"
  185.       Height          =   255
  186.       Left            =   2880
  187.       TabIndex        =   11
  188.       Top             =   120
  189.       Width           =   3015
  190.    End
  191. Attribute VB_Name = "SelectFields"
  192. Attribute VB_GlobalNameSpace = False
  193. Attribute VB_Creatable = False
  194. Attribute VB_PredeclaredId = True
  195. Attribute VB_Exposed = False
  196. Private Sub btnBack_Click()
  197.     SelectFields.Unload
  198.     NewReport.Show 1
  199. End Sub
  200. Private Sub btnCancel_Click()
  201.     End
  202. End Sub
  203. Private Sub btnGetAllFields_Click()
  204.     Dim NumFields As Integer
  205.     ' Move the all available fields to the selected field list.
  206.     For NumFields = 0 To lstAvailable.ListCount - 1
  207.         lstAvailable.ListIndex = NumFields
  208.         lstSelectedFields.AddItem lstAvailable.Text
  209.         SQL.Fields.Add lstAvailable.Text, lstAvailable.Text
  210.         SQL.Fields.Item(SQL.Fields.Count).TableName = cboTables.Text
  211.     Next NumFields
  212. End Sub
  213. Private Sub btnGetField_Click()
  214.     ' Move the available field to the selected field list.
  215.     If lstAvailable.ListIndex <> -1 Then
  216.         lstSelectedFields.AddItem lstAvailable.Text
  217.         SQL.Fields.Add lstAvailable.Text, lstAvailable.Text
  218.         SQL.Fields.Item(SQL.Fields.Count).TableName = cboTables.Text
  219.     End If
  220. End Sub
  221. Private Sub btnNext_Click()
  222.     SelectFields.Hide
  223.     Grouping.Show 1
  224. End Sub
  225. Private Sub btnRemoveAllFields_Click()
  226.     Dim x As Integer
  227.     'Remove all fields from teh list of selected fields.
  228.     lstSelectedFields.Clear
  229.     For x = 1 To SQL.Fields.Count
  230.         SQL.Fields.Remove 1
  231.     Next x
  232. End Sub
  233. Private Sub btnRemoveField_Click()
  234.     ' Remove the field from the list of selected fields.
  235.     If lstSelectedFields.ListIndex <> -1 Then
  236.         SQL.Fields.Remove lstSelectedFields.ListIndex + 1
  237.         lstSelectedFields.RemoveItem lstSelectedFields.ListIndex
  238.     End If
  239. End Sub
  240. Private Sub cboTables_Click()
  241.     ' Fill in the available list any time the table name changes.
  242.     lstAvailable.Clear
  243.     Call GetColumns(lstAvailable, cboTables.Text)
  244. End Sub
  245. Private Sub Form_Load()
  246.         
  247.     ' Fill in the combo with list of tables.
  248.     Call GetTables(cboTables)
  249.     ' Select the table that was chosen on the first dialog
  250.     cboTables.Text = NewReport.cboTables.Text
  251.     ' Fill in the available columns listbox.
  252.     lstAvailable.Clear
  253.     Call GetColumns(lstAvailable, cboTables.Text)
  254. End Sub
  255. Private Sub lstAvailable_DblClick()
  256.     ' Move the available field to the selected field list.
  257.     If lstAvailable.ListIndex <> -1 Then
  258.         lstSelectedFields.AddItem lstAvailable.Text
  259.         SQL.Fields.Add lstAvailable.Text, lstAvailable.Text
  260.         SQL.Fields.Item(SQL.Fields.Count).TableName = cboTables.Text
  261.     End If
  262. End Sub
  263. Private Sub lstSelectedFields_DblClick()
  264.     ' Remove the field from the list of selected fields.
  265.     If lstSelectedFields.ListIndex <> -1 Then
  266.         SQL.Fields.Remove lstSelectedFields.Text
  267.         lstSelectedFields.RemoveItem lstSelectedFields.ListIndex
  268.     End If
  269. End Sub
  270.